# 作者: spy
# 开发时间: 2021/12/14 10:42

import time
import unittest

from selenium import webdriver


class BaseUtil(unittest.TestCase):
    # 重写了unittest里的setUp和tearDown
    def setUp(self) -> None:
        global driver
        # 打开浏览器
        option = webdriver.ChromeOptions()  # 加载浏览器配置
        option.add_argument('-kiosk')  # 启动时自动全屏(相当于在浏览器界面按F11按键)
        self.driver = webdriver.Chrome(options=option)
        driver = self.driver
        # 加载网页
        self.driver.get("http://192.168.31.33:8000/user/login")

    def tearDown(self) -> None:
        time.sleep(3)
        self.driver.quit()
